﻿using System;
using NLog;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Threading;

namespace WinFormsNlog
{
    public partial class Form1 : Form
    {
        static Logger logger => LogManager.GetCurrentClassLogger();
        public Form1()
        {
            InitializeComponent();
        }


        private void Form1_Load(object sender, EventArgs e)
        {
            // TODO: 这行代码将数据加载到表“nLogDataSet.NLog”中。您可以根据需要移动或删除它。
            this.nLogTableAdapter.Fill(this.nLogDataSet.NLog);
            Thread thread = new Thread(init);
            thread.Start();


        }

        private static void init()
        {
            while (true)
            {
               
                //logger.Info(DateTime.Now);
                //logger.Error(DateTime.Now);
               //logger.Info(DateTime.Now.ToString("yyyyMMdd"));
               //logger.Trace(DateTime.Now.ToString("yyyyMMdd"));
               //logger.Warn(DateTime.Now.ToString("yyyyMMdd"));
               //logger.Error(DateTime.Now.ToString("yyyyMMdd"));
               //logger.Debug(DateTime.Now.ToString("yyyyMMdd"));
               //logger.Fatal(DateTime.Now.ToString("yyyyMMdd"));
                Thread.Sleep(100);
            }

        }
    }
}
